package main;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

public class SensorPanel extends JPanel implements MouseListener {
	
	public SensorPanel() {
		setSize(200, 200);
	    setPreferredSize(new Dimension(200, 200));
	    setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
	    addMouseListener(this);
	}

	public void paintComponent(Graphics g) {
        Robot.drawAlone(g);
    }
	
	
	@Override
	public void mouseClicked(MouseEvent e) {
		if (Simulator.timer.isRunning()) {
			return;
		}
		
		UserInterface.setContentPane(UserInterface.sensorSelection);
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		setCursor(new Cursor(Cursor.HAND_CURSOR));
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		setCursor(new Cursor(Cursor.DEFAULT_CURSOR));		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
    
}
